<?php
$siswa = array();

foreach($data->result_array() as $row)
$siswa = $row;
?>

	<!-- BEGIN PAGE -->
	<div class="page-content">
         <!-- BEGIN PAGE CONTAINER-->        
         <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
			<div class="row-fluid">
				<div class="span12"> 
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->			
					<h3 class="page-title">
						Form Pendataan Siswa <small> menambah dan mengedit data siswa</small>
					</h3>
					<ul class="breadcrumb">
						<li>
							<i class="icon-cogs"></i>
							Kesiswaan		
							<i class="icon-angle-right"></i>
						</li>
						<li>
							<a href="<?php echo base_url()?>pendataanSiswa">Siswa</a>		
							<i class="icon-angle-right"></i>
						</li>
						<li>Form Pendataan Siswa</li>	
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN PAGE CONTENT-->          
            <div class="row-fluid">
				
               <div class="span12">
                  <!-- BEGIN SAMPLE TABLE PORTLET-->
                  <div class="portlet box green">
                     <div class="portlet-title">
                        <div class="caption"><i class="icon-cogs"></i>Form Pendataan Siswa</div>
                     </div>
                     <div class="portlet-body form">
                        <!-- BEGIN FORM-->
						<form id="form-siswa" action="" class="form-horizontal form-bordered form-row-stripped" action="<?php echo base_url()."pendataanSiswa/form/".(isset($siswa['siswa_id'])?encode($siswa['siswa_id']):'')?>" method="post" enctype="multipart/form-data">  
						<div class="row-fluid">
							<div class="span9">
								<div class="control-group">
								  <label class="control-label">Departemen</label>
									  <div class="controls">
									  <input type="hidden" name="data[departemen_id]" value="<?php echo $departemen_id ?>" />
										<?php
											foreach($departemen->result_array() as $row){
												if($departemen_id == $row['departemen_id']){
													echo '<input class="m-wrap span6"type="text" value="'.$row['nama'].'" readonly="readonly" />';
													break;
												}
											}
										?> 
								  </div>
							   </div>  
							   <div class="control-group">
								  <label class="control-label">Tahun Ajaran</label>
									  <div class="controls">
									  <input type="hidden" name="data[tahun_ajaran]" value="<?php echo $tahun_ajaran_id ?>" />
										<?php
											foreach($tahun_ajaran->result_array() as $row){
												if($tahun_ajaran_id == $row['tahun_ajaran_id']){
													echo '<input class="m-wrap span6"type="text" value="'.$row['tahun_ajaran'].'" readonly="readonly" />';
													break;
												}
											}
										?> 
								  </div>
							   </div>  
							   <div class="control-group">
								  <label class="control-label">Semester</label>
									  <div class="controls">
									  <input type="hidden" name="data[semester_id]" value="<?php echo $semester_id ?>" />
										<?php
											foreach($semester->result_array() as $row){
												if($semester_id == $row['semester_id']){
													echo '<input class="m-wrap span6"type="text" value="'.$row['semester'].'" readonly="readonly" />';
													break;
												}
											}
										?> 
								  </div>
							   </div> 
							   <div class="control-group">
								  <label class="control-label">Kelas</label>
									  <div class="controls">
									  <input type="hidden" name="data[tingkat_id]" value="<?php echo $kelas_id ?>" />
										<?php
											foreach($kelas->result_array() as $row){
												if($kelas_id == $row['tingkat_id']){
													echo '<input class="m-wrap span6"type="text" value="'.$row['tingkat'].'" readonly="readonly" />';
													break;
												}
											}
										?> 
								  </div>
							   </div> 
							      <div class="control-group">
								  <label class="control-label">Ruang Kelas</label>
									  <div class="controls">
									  <input type="hidden" name="data[kelas_id]" value="<?php echo $pembagian_kelas_id ?>" />
										<?php
											foreach($pembagian_kelas->result_array() as $row){
												if($pembagian_kelas_id == $row['kelas_id']){
													echo '<input class="m-wrap span6"type="text" value="'.$row['kelas'].'" readonly="readonly" />';
													break;
												}
											}
										?> 
								  </div>
							   </div> 
								<div class="control-group">
									<label class="control-label" for="firstName">Nis</label>
									<div class="controls">
									   <input type="text" id="nis" name="data[nis]" value="<?php echo isset($siswa['nis'])?$siswa['nis']:''?>" class="m-wrap span8" placeholder="Masukkan NIS" required>
									</div>
								 </div>
								<div class="control-group">
									<label class="control-label" for="lastName">Nama</label>
									<div class="controls">
									   <input type="text" id="nama" name="data[nama]" value="<?php echo isset($siswa['nama'])?$siswa['nama']:''?>" class="m-wrap span8 popovers" data-trigger="hover" data-content="hai" placeholder="Masukkan Nama" required>
									</div>
								</div>
								<div class="control-group">
								   <label class="control-label" for="lastName">Panggilan</label>
									<div class="controls">
									   <input type="text" id="panggilan" name="data[panggilan]" value="<?php echo isset($siswa['panggilan'])?$siswa['panggilan']:''?>" class="m-wrap span8" placeholder="Masukkan Panggilan" required>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="firstName">Tahun Masuk</label>
									<div class="controls">
									   <input type="text" id="tahun_masuk" name="data[tahun_masuk]" value="<?php echo isset($siswa['tahun_masuk'])?$siswa['tahun_masuk']:''?>" class="m-wrap span8" placeholder="Masukkan Tahun Masuk" required>
									</div>
								 </div>
								<div class="control-group">
									<label class="control-label">Angkatan</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[angkatan_id]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Angkatan -------</option>
											<?php foreach($angkatan->result_array() as $row){?>
											 <option value="<?php echo $row['angkatan_id']?>" <?php echo isset($siswa['angkatan_id']) && $siswa['angkatan_id'] == $row['angkatan_id']?'selected="selected"':''?>><?php echo $row['angkatan']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								</div>
								<div class="span3">
									<div class="control-group">
										 <div class="fileupload fileupload-new" data-provides="fileupload" style="margin-top:10px;">
											<div class="fileupload-new thumbnail" style="width: 200px; height: 220px;">
												<?php if(isset($siswa['foto'])){?>
												<img src="<?php echo 'data:image/png;base64,'.base64_encode($siswa['foto'])?>" alt="" />
												<?php }else{?>
											   <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt="" />
											   <?php } ?>
											</div>
											<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
											<div>
											   <input type="file" name="userfile" class="default" /></span>
											</div>
										 </div>	
									  </div>
								</div>
							</div>
								<div class="control-group">
									<label class="control-label">Suku</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[suku_id]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Suku -------</option>
											<?php foreach($suku->result_array() as $row){?>
											 <option value="<?php echo $row['suku_id']?>" <?php echo isset($siswa['suku_id']) && $siswa['suku_id'] == $row['suku_id']?'selected="selected"':''?>><?php echo $row['suku']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Agama</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[agama_id]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Agama -------</option>
											<?php foreach($agama->result_array() as $row){?>
											 <option value="<?php echo $row['agama_id']?>" <?php echo isset($siswa['agama_id']) && $siswa['agama_id'] == $row['agama_id']?'selected="selected"':''?>><?php echo $row['agama']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Status Siswa</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[status_siswa_id]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Status Siswa -------</option>
											<?php foreach($status_siswa->result_array() as $row){?>
											 <option value="<?php echo $row['status_siswa_id']?>" <?php echo isset($siswa['status_siswa_id']) && $siswa['status_siswa_id'] == $row['status_siswa_id']?'selected="selected"':''?>><?php echo $row['status']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Kondisi Siswa</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[kondisi_siswa_id]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Status Siswa -------</option>
											<?php foreach($kondisi_siswa->result_array() as $row){?>
											 <option value="<?php echo $row['kondisi_siswa_id']?>" <?php echo isset($siswa['kondisi_siswa_id']) && $siswa['kondisi_siswa_id'] == $row['kondisi_siswa_id']?'selected="selected"':''?>><?php echo $row['kondisi']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									  <label class="control-label">Jenis Kelamin</label>
									  <div class="controls">
										 <label class="radio">
										 <input type="radio" name="data[kelamin]" value="L"  <?php echo (isset($siswa['kelamin']) &&  $siswa['kelamin'] == "L")?'checked="checked"':''?> checked />
										 Laki-laki
										 </label>
										 <label class="radio">
										 <input type="radio" name="data[kelamin]" value="P" <?php echo (isset($siswa['kelamin']) &&  $siswa['kelamin'] == 
										 "P")?'checked="checked"':''?> />
										 Perempuan
										 </label>                                
									  </div>
								   </div> 
								 <div class="control-group">
									<label class="control-label" for="lastName">Tempat Lahir</label>
									<div class="controls">
									   <input type="text" id="tmp_lahir" name="data[tmp_lahir]" value="<?php echo isset($siswa['tmp_lahir'])?$siswa['tmp_lahir']:''?>" class="m-wrap span4" placeholder="Masukkan Tempat Lahir">
									</div>
								 </div>             
								 <div class="control-group">
									<label class="control-label" >Tanggal Lahir</label>
									<div class="controls">    
										<?php
											if(isset($siswa['tgl_lahir'])){
												$date = explode("-",$siswa['tgl_lahir']);
											}else{
												$date = explode("-",date("Y-m-d"));
											}
										?>
									   <select id="day" name="day" class="span2 m-wrap select2">
										<?php for($i=1;$i<32;$i++){?>
										<option value="<?php echo $i<10?"0$i":$i?>" <?php echo (int)$date[2] == (int)$i?'selected="selected"':''?>><?php echo $i<10?"0$i":$i?></option>
										<?php } ?>
									 </select>
									 <select id="month" name="month" class="span3 m-wrap select2">
										<?php foreach(bulans() as $key=>$value){?>
										<option value="<?php echo ($key+1) < 10?"0".($key+1):$key+1?>" <?php echo $date[1] == $key+1?'selected="selected"':''?>><?php echo $value?></option>
										<?php } ?>
									 </select>
									 <select id="year" name="year" class="span3 m-wrap select2">
										<?php
										$year = date("Y")-80;
										for($i=0;$i<=80;$i++){
										?>
										<option value="<?php echo $year+$i?>" <?php echo $date[0] == $year+$i?'selected="selected"':''?>><?php echo $year+$i?></option>
										<?php } ?>
									 </select>
									 <a href="#" class="btn" id="btn-date" data-date-format="yyyy-mm-dd"><i class="icon-calendar"></i> Kalender</a>
									
									<script>
										$(document).ready(function(){
											$('#btn-date').datepicker()
												.on('show', function(ev){
													var date = $("#year").val()+"-"+$("#month").val()+"-"+$("#day").val();
													$('#btn-date').data({date: date});
													$('#btn-date').datepicker('update');
												})
												.on('changeDate', function(ev){
													$('#btn-date').datepicker('hide');
													
													var date = new Date(ev.date);
													var month = date.getMonth()+1;
													var mth = "";
													if(month < 10){
														mth = "0"+month;
													}
													
													$("#year").select2("val", date.getFullYear());
													$("#month").select2("val", mth);
													$("#day").select2("val", date.getDate());
												});
										})
									</script> 
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Warga</label>
									<div class="controls">
									   <input type="text" id="warga" name="data[warga]" value="<?php echo isset($siswa['warga'])?$siswa['warga']:''?>" class="m-wrap span4" placeholder="Masukkan Warga">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Anak Ke</label>
									<div class="controls">
									   <input type="text" id="anak_ke" name="data[anak_ke]" value="<?php echo isset($siswa['anak_ke'])?$siswa['anak_ke']:''?>" class="m-wrap span4" placeholder="Masukkan Anak Ke">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Jumlah Saudara</label>
									<div class="controls">
									   <input type="text" id="jml_saudara" name="data[jml_saudara]" value="<?php echo isset($siswa['jml_saudara'])?$siswa['jml_saudara']:''?>" class="m-wrap span4" placeholder="Masukkan Jumlah Saudara">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Bahasa</label>
									<div class="controls">
									   <input type="text" id="bahasa" name="data[bahasa]" value="<?php echo isset($siswa['bahasa'])?$siswa['bahasa']:''?>" class="m-wrap span4" placeholder="Masukkan Bahasa">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">berat</label>
									<div class="controls">
									   <input type="text" id="berat" name="data[berat]" value="<?php echo isset($siswa['berat'])?$siswa['berat']:''?>" class="m-wrap span4" placeholder="Masukkan berat">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Tinggi</label>
									<div class="controls">
									   <input type="text" id="tinggi" name="data[tinggi]" value="<?php echo isset($siswa['tinggi'])?$siswa['tinggi']:''?>" class="m-wrap span4" placeholder="Masukkan Tinggi">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Darah</label>
									<div class="controls">
									   <input type="text" id="darah" name="data[darah]" value="<?php echo isset($siswa['darah'])?$siswa['darah']:''?>" class="m-wrap span4" placeholder="Masukkan Darah">
									</div>
								 </div> 
								 <div class="control-group">
								    <label class="control-label">Alamat</label>
								    <div class="controls">
									   <textarea class="span6 m-wrap" name="data[alamat_siswa]" rows="3"><?php echo isset($siswa['alamat_siswa'])?$siswa['alamat_siswa']:''?></textarea>
								    </div>
							     </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Kode Pos</label>
									<div class="controls">
									   <input type="text" id="kodepos_siswa" name="data[kodepos_siswa]" value="<?php echo isset($siswa['kodepos_siswa'])?$siswa['kodepos_siswa']:''?>" class="m-wrap span4" placeholder="Masukkan Kode Pos">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Telp Siswa</label>
									<div class="controls">
									   <input type="text" id="telpon_siswa" name="data[telpon_siswa]" value="<?php echo isset($siswa['telpon_siswa'])?$siswa['telpon_siswa']:''?>" class="m-wrap span4" placeholder="Masukkan Telp Siswa">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Hp Siswa</label>
									<div class="controls">
									   <input type="text" id="hp_siswa" name="data[hp_siswa]" value="<?php echo isset($siswa['hp_siswa'])?$siswa['hp_siswa']:''?>" class="m-wrap span4" placeholder="Masukkan Hp Siswa">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Email Siswa</label>
									<div class="controls">
									   <input type="text" id="email_siswa" name="data[email_siswa]" value="<?php echo isset($siswa['email_siswa'])?$siswa['email_siswa']:''?>" class="m-wrap span4" placeholder="Masukkan Email Siswa">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Kesehatan Siswa</label>
									<div class="controls">
									   <input type="text" id="kesehatan" name="data[kesehatan]" value="<?php echo isset($siswa['kesehatan'])?$siswa['kesehatan']:''?>" class="m-wrap span4" placeholder="Masukkan Kesehatan Siswa">
									</div>
								 </div>   
								 <div class="control-group">
								  <label class="control-label">Asal Sekolah</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[asal_sekolah_id]" data-placeholder="" tabindex="1">
											<option value="">------- Pilih Asal Sekolah -------</option>
											<?php foreach($asal_sekolah->result_array() as $row){?>
											 <option value="<?php echo $row['asal_sekolah_id']?>" <?php echo isset($siswa['asal_sekolah_id']) && $siswa['asal_sekolah_id'] == $row['asal_sekolah_id']?'selected="selected"':''?>><?php echo $row['sekolah']?></option>
											<?php } ?>
										</select>
									</div>
								</div> 
								 <div class="control-group">
								    <label class="control-label">Keterangan Sekolah</label>
								    <div class="controls">
									   <textarea class="span6 m-wrap" name="data[ket_sekolah]" rows="3"><?php echo isset($siswa['ket_sekolah'])?$siswa['ket_sekolah']:''?></textarea>
								    </div>
							     </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Nama Ayah</label>
									<div class="controls">
									   <input type="text" id="nama_ayah" name="data[nama_ayah]" value="<?php echo isset($siswa['nama_ayah'])?$siswa['nama_ayah']:''?>" class="m-wrap span4" placeholder="Masukkan Nama Ayah Siswa">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Nama Ibu</label>
									<div class="controls">
									   <input type="text" id="nama_ibu" name="data[nama_ibu]" value="<?php echo isset($siswa['nama_ibu'])?$siswa['nama_ibu']:''?>" class="m-wrap span4" placeholder="Masukkan Nama Ibu Siswa">
									</div>
								 </div> 
								 <div class="control-group">
									<label class="control-label">Pendidikan Ayah</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[pendidikan_ayah]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Tingkat Pendidikan -------</option>
											<?php foreach($tingkat_pendidikan->result_array() as $row){?>
											 <option value="<?php echo $row['tingkat_pendidikan_id']?>" <?php echo isset($siswa['pendidikan_ayah']) && $siswa['pendidikan_ayah'] == $row['tingkat_pendidikan_id']?'selected="selected"':''?>><?php echo $row['pendidikan']?></option>
											<?php } ?>
										</select>
									</div>
								</div> 
								 <div class="control-group">
									<label class="control-label">Pendidikan Ibu</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[pendidikan_ibu]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Tingkat Pendidikan -------</option>
											<?php foreach($tingkat_pendidikan->result_array() as $row){?>
											 <option value="<?php echo $row['tingkat_pendidikan_id']?>" <?php echo isset($siswa['pendidikan_ibu']) && $siswa['pendidikan_ibu'] == $row['tingkat_pendidikan_id']?'selected="selected"':''?>><?php echo $row['pendidikan']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Pekerjaan Ayah</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[pekerjaan_ayah]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Pekerjaan -------</option>
											<?php foreach($jenis_pekerjaan->result_array() as $row){?>
											 <option value="<?php echo $row['jenis_pekerjaan_id']?>" <?php echo isset($siswa['pekerjaan_ayah']) && $siswa['pekerjaan_ayah'] == $row['jenis_pekerjaan_id']?'selected="selected"':''?>><?php echo $row['pekerjaan']?></option>
											<?php } ?>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">Pekerjaan Ibu</label>
									  <div class="controls">
										 <select class="span6 m-wrap large" name="data[pekerjaan_ibu]" data-placeholder="Choose a Category" tabindex="1">
											<option value="">------- Pilih Pekerjaan -------</option>
											<?php foreach($jenis_pekerjaan->result_array() as $row){?>
											 <option value="<?php echo $row['jenis_pekerjaan_id']?>" <?php echo isset($siswa['pekerjaan_ibu']) && $siswa['pekerjaan_ibu'] == $row['jenis_pekerjaan_id']?'selected="selected"':''?>><?php echo $row['pekerjaan']?></option>
											<?php } ?>
										</select>
									</div>
								</div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Wali</label>
									<div class="controls">
									   <input type="text" id="wali" name="data[wali]" value="<?php echo isset($siswa['wali'])?$siswa['wali']:''?>" class="m-wrap span4" placeholder="Masukkan Wali">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Penghasilan Ayah</label>
									<div class="controls">
									   <input type="text" id="penghasilan_ayah" name="data[penghasilan_ayah]" value="<?php echo isset($siswa['penghasilan_ayah'])?$siswa['penghasilan_ayah']:''?>" class="m-wrap span4" placeholder="Masukkan Penghasilan Ayah">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Penghasilan Ibu</label>
									<div class="controls">
									   <input type="text" id="penghasilan_ibu" name="data[penghasilan_ibu]" value="<?php echo isset($siswa['penghasilan_ibu'])?$siswa['penghasilan_ibu']:''?>" class="m-wrap span4" placeholder="Masukkan Penghasilan Ibu">
									</div>
								 </div> 
								 <div class="control-group">
								    <label class="control-label">Alamat Orang Tua</label>
								    <div class="controls">
									   <textarea class="span6 m-wrap" name="data[alamat_ortu]" rows="3"><?php echo isset($siswa['alamat_ortu'])?$siswa['alamat_ortu']:''?></textarea>
								    </div>
							     </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Telp Orang Tua</label>
									<div class="controls">
									   <input type="text" id="telpon_ortu" name="data[telpon_ortu]" value="<?php echo isset($siswa['telpon_ortu'])?$siswa['telpon_ortu']:''?>" class="m-wrap span4" placeholder="Masukkan Telp Orang Tua">
									</div>
								 </div>	 
								 <div class="control-group">
									<label class="control-label" for="lastName">Hp Orang Tua</label>
									<div class="controls">
									   <input type="text" id="hp_ortu" name="data[hp_ortu]" value="<?php echo isset($siswa['hp_ortu'])?$siswa['hp_ortu']:''?>" class="m-wrap span4" placeholder="Masukkan Hp Orang Tua">
									</div>
								 </div>
								 <div class="control-group">
									<label class="control-label" for="lastName">Email Ayah</label>
									<div class="controls">
									   <input type="text" id="email_ayah" name="data[email_ayah]" value="<?php echo isset($siswa['email_ayah'])?$siswa['email_ayah']:''?>" class="m-wrap span4" placeholder="Masukkan Email Ayah">
									</div>
								 </div>
								 <div class="control-group">
									<label class="control-label" for="lastName">Email Ibu</label>
									<div class="controls">
									   <input type="text" id="email_ibu" name="data[email_ibu]" value="<?php echo isset($siswa['email_ibu'])?$siswa['email_ibu']:''?>" class="m-wrap span4" placeholder="Masukkan Email Ibu">
									</div>
								 </div>
								 <div class="control-group">
								  <label class="control-label">Aktif</label>
								  <div class="controls">
									 <label class="radio">
									 <input type="radio" name="data[aktif]" value=1  <?php echo (isset($pegawai['aktif']) &&  $pegawai['aktif'] == 1)?'checked="checked"':''?> checked />
									 Ya
									 </label>
									 <label class="radio">
									 <input type="radio" name="data[aktif]" value=0 <?php echo (isset($pegawai['aktif']) &&  $pegawai['aktif'] == 0)?'checked="checked"':''?> />
									 Tidak
									 </label>                                
								  </div>
							     </div> 
								 <div class="control-group">
								    <label class="control-label">Keterangan</label>
								    <div class="controls">
									   <textarea class="span6 m-wrap" name="data[keterangan]" rows="3"><?php echo isset($siswa['keterangan'])?$siswa['keterangan']:''?></textarea>
								    </div>
							     </div>
								<div class="form-actions">
								   <button type="submit" class="btn blue"><i class="icon-ok"></i> Simpan</button>
								   <a href="<?php echo base_url()?>pendataanSiswa" type="button" class="btn">Batal</a>
								</div>
					</form>
                                 <!-- END FORM--> 
			 </div>
		  </div>
                  <!-- END SAMPLE TABLE PORTLET-->
	   </div>				
	</div>
           
            <!-- END PAGE CONTENT-->
         </div>
         <!-- END PAGE CONTAINER-->
    </div>
    <!-- END PAGE -->
	<script>
		$(document).ready(function(){
			$("#form-siswa").validate(
				{
					errorElement: 'span', //default input error message container
					errorClass: 'help-inline', // default input error message class
					focusInvalid: false, // do not focus the last invalid input
					ignore: "",
					highlight: function (element) { // hightlight error inputs
						$(element)
							.closest('.help-inline').removeClass('ok'); // display OK icon
						$(element)
							.closest('.control-group').removeClass('success').addClass('error'); // set error class to the control group
					},

					unhighlight: function (element) { // revert the change dony by hightlight
						$(element)
							.closest('.control-group').removeClass('error'); // set error class to the control group
					},

					success: function (label) {
						label
							.addClass('valid').addClass('help-inline ok') // mark the current input as valid and display OK icon
						.closest('.control-group').removeClass('error').addClass('success'); // set success class to the control group
					}
				}
			);
			
			$('.select2').select2();
		});
	</script>
	<?php $this->load->view('template/messages'); ?>
